<?php

class Am_Navigation_UserCP_Item_Separator extends Zend_Navigation_Page {
    public function getHref() {   }
    function getClass(){
        return "menu-separator";
    }
    function xxx(){
        $url = htmlentities(REL_ROOT_URL . "/application/default/views/public/img/admin/menu-sep.gif");
        return "<div style='background-image: url(\"$url\"); background-repeat: repeat-x; height: 5px;'>&nbsp;</div>";
    }
}

class Am_Navigation_UserCP extends Zend_Navigation_Container
{
    function addDefaultPages()
    {
        $separator = new Am_Navigation_UserCP_Item_Separator;

        $this->addPage(array(
            'id' => 'dashboard',
            'controller' => 'usercp',
            'label' => ___("Dashboard")
        ));

        $this->addPage(Zend_Navigation_Page::factory(array(
            'id' => 'jobs',
            'uri' => '#',
            'label' => ___("Jobs"),
            'resource' => 'grid_u',
            'privilege' => 'browse',
            'pages' =>
            array_merge(
            array(
                array(
                    'id' => 'jobs-browse',
                    'controller' => 'usercp-jobs',
                    'label' => ___('Browse Jobs'),
                    'resource' => 'grid_u',
                    'privilege' => 'browse',
                    'class' => 'bold',
                ),
                array(
                    'id' => 'jobs-insert',
                    'uri' => REL_ROOT_URL . '/usercp-jobs?_j_a=insert',
                    'label' => ___('Add Job'),
                    'resource' => 'grid_u',
                    'privilege' => 'insert',
               ),
            )
           )
        )));
	     
    //    Am_Di::getInstance()->hook->call(Am_Event::ADMIN_MENU, array('menu' => $this));
        
        /// workaround against using the current route for generating urls
        foreach (new RecursiveIteratorIterator($this, RecursiveIteratorIterator::SELF_FIRST) as $child)
            if ($child instanceof Zend_Navigation_Page_Mvc && $child->getRoute()===null)
                $child->setRoute('default');
    }
}